package org.socialresume.client.mvp.event;

import org.socialresume.client.mvp.event.handler.AdminModeEventHandler;

import com.google.gwt.event.shared.GwtEvent;

public class AdminModeEvent extends GwtEvent<AdminModeEventHandler> {

	private static Type<AdminModeEventHandler> TYPE;

    public static Type<AdminModeEventHandler> getType() {
            return TYPE != null ? TYPE : (TYPE = new Type<AdminModeEventHandler>());
    }

    private final boolean adminMode;

    public AdminModeEvent(boolean adminMode) {
            this.adminMode = adminMode;
    }


    public boolean isAdminMode() {
		return adminMode;
	}


	@Override
    public final Type<AdminModeEventHandler> getAssociatedType() {
            return getType();
    }

    @Override
    protected void dispatch(AdminModeEventHandler handler) {
            handler.onAdminModeEvent(this);
    }
}
